<!-- 任务执行情况 -->
<template>
  <div class="rourmCenter-right-one linebox">
    <div class="rightlist" @click="forumcommentFn(1)" v-if="plateList.length">
      <span class="iconfont iconxiaoxi2"></span>
      <p>我的消息</p>
    </div>
    <div class="rightlist" @click="forumcommentFn(2,2)">
      <span class="iconfont iconzanpress"></span>
      <p>我的点赞</p>
    </div>
    <div class="rightlist" @click="forumcommentFn(2,1)">
      <span class="iconfont iconwenzhang-pinglunx"></span>
      <p>我的评论</p>
    </div>
    <div class="rightlist" @click="myarticleFn" v-if="plateList.length">
      <span class="iconfont iconwodewenzhang"></span>
      <p>我的文章</p>
    </div>
    <div class="rightlist" @click="addarticlFn" v-if="plateList.length">
      <span class="iconfont iconfabuwenzhang"></span>
      <p>发布文章</p>
    </div>
    <div class="rightlist" @click="forumexamine" v-if="examineList.length">
      <span class="iconfont iconwenzhangshenhe"></span>
      <p>审核文章</p>
    </div>
    <!--    添加编辑文章-->
    <addForum :visible.sync="detailVisible"></addForum>
    <!--    审核文章-->
    <examineArticle :visible.sync="examineVisible"></examineArticle>
    <!--    我的点赞/我的评论-->
    <mylandCommon :visible.sync="landeVisible" :landType="landType"></mylandCommon>
<!--    我的文章-->
    <myArticle :visible.sync="myarticleVisible"></myArticle>
  </div>
</template>
<script>
import api from '@/utils/api.js'
import addForum from "./addForum";
import examineArticle from "./examineArticle";
import mylandCommon from "./mylandCommon";
import myArticle from "./myArticle";

export default {
  name: 'taskListDialog',
  components: {
    addForum,
    examineArticle,
    mylandCommon,
    myArticle
  },
  data() {
    return {
      landeVisible: false,
      detailVisible: false,
      examineVisible: false,
      oneState: false,
      userInfo: null,
      examineList: [], // 担任审核得博主
      plateList: [], // 担任得版块博主
      landType:1,
      myarticleVisible:  false
    }
  },
  created() {
    this.userInfoFn()
  },
  methods: {
    userInfoFn() {
      this.$fetch(api.admin_user_detail, {}).then((response) => {
        if (response.code === 0) {
          if (response.detail.id === 1) {
            if (response.examine.length && response.plate.length) {
              this.oneState = true
            }
          } else {
            this.oneState = true
            this.userInfo = response.detail
            this.examineList = response.examine || []
            this.plateList = response.plate || []
          }
        } else {
        }
      }).catch((err) => {
        console.log(err)
      })
    },
    addarticlFn() {
      this.detailVisible = true
      // this.$router.push('/forumarticledit')
    },
    forumcommentFn(option, type) {
      // type 1我的消息 2我的评论
      this.landType = type
      this.landeVisible = true
      // let type_ = type || ''
      // this.$router.push('/forumcomment?type=' + option + '&tab=' + type_)
    },
    forumexamine() {
      this.examineVisible = true;
      // this.$router.push('/forumexamine')
    },
    myarticleFn() {
      this.myarticleVisible =true;
      // this.$router.push('/myarticle')
    }
  },
  mounted() {
  }
}
</script>
<style>
.cateBody {
  padding: 40px 0;
}
</style>
